# import csv
# import pandas as pd
# import logging
# logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
#
# data = pd.read_csv('../MachineLearning/Rent_price/proxy_data_all.csv')
# ip = data['IP']
# post = data['Port']
# for i in range(100):
#     with open('proxy_data.csv', 'a', newline='', encoding='utf-8') as csvfile:
#         writer = csv.writer(csvfile)
#         # 写入表头，需要根据实际数据调整
#         tem = [ip[i], post[i]]
#         logging.info(f'第{i}条ip写入成功,内容为{tem}')
#         writer.writerow(['IP', 'Port'])
#         writer.writerow(tem)


# 考试题型：
# 程序改错题 10
# 程序填空题 10
# 程序阅读题 7＊2
# 应用分析题 9＊2
# 程序设计题 12＊4
# 游戏

# 不可变类型 str ----> 字符串

# 选择结构 ---->
# 1.简单的知识点
# 2.if语句的嵌套
# a = 10


# 0 None [] {} ---> False
# if a > 100:
#     print('a > 100')
# elif 1:
#     print('狗屎')
# elif a == 10:
#     print('a == 10')
# else:
#     print('a')

# for while

# [0,1,2,3,4,5,6,7,8,9 ...99]
# s = 'abas '
# arr = [1, 2222, 333, 4, 5, 6, 7, 8, 9]
#
# for i in s:
#     print(i)
    # if i == 5:
    #     continue
    # print(arr[i], end=' ')

# 循环加 选择
# a = 1
# while a < 10:
#     if a == 3:
#         a += 2
#         break
#     print(a)
#     a += 1

# 序列

# 1，列表
# 2，元组
# 3，字符串
# [],[:],append,extend,len,insert
# 类型转换
# s = 'abcd'
# a = list(s) # a = ['a','b','c','d']
# print(len(a))
# print(len(s))
# 1,index
# print(a[1])
# a[1] = 'e'
# print(a)
# 2,sub
# print(a)
# print(a[1:3])

# extend
# b = [1,2,3]
# a.extend(b)
# print(a)

# append
# a.append('p')
# print(a)

# insert
# a.insert(1,'pp')
# print(a)

# tuple
# a = (1,2,3)
# print(a[0])
# print(a[1:3])

# print(range(100))


# 函数

# def ymq(a):
#     if a == 1:
#         return 1
#     while a > 1:
#         a -= 1
#         return a + ymq(a)
#     for i in range(10):
#         print(i)
#
# b = ymq(1)
# print(b)

# 继承
# class ymq:
#     def __init__(self,heigt,w):
#         self.heigt = heigt
#         self.w = w
#
#     def speek(self,a):
#         print(a)
#         print(self.heigt)
#         print("ymq speek:" + "hello world")


#
#
#
# # 初始化
# good1 = ymq(1.6,100)
# print(good1)
# good1.speek(222)

# 编码  0010101010101
# 1，ASCII
# 2，Unicode
# 3，UTF-8
# 4，GBK
# with open('example.txt', 'w', encoding='utf-8') as file:
    # 读取文件内容
    # file.write("ymq")
    # print(content)


# import time
#
# print("Hello World")
# time.sleep(5)
# print("Goodbye World")

# import asyncio
#
#
# async def func(flags):
#     print("func() start")
#     await asyncio.sleep(2)   # 这里模拟IO操作
#     print("func() end")
#     return "我是 func(" + flags + ")"
#
#
# async def main():
#     print("执行协程函数 main()")
#
#     # 遇到IO操作挂起当前协程(任务)，等待IO操作完成之后在继续往下执行，当前协程挂起，事件循环可以去执行其他的协程(任务)
#     result = await func("1")
#     print("IO第一次的请求结果：", result)
#
#     result = await func("2")
#     print("IO第二次的请求结果：", result)
#
# asyncio.run(main())


